<?php
/**
 * @description : request a unauthorized Request Token
 * @author : stephen
 * @date : 2010/07/07
 */
//ini_set('display_errors','on');
require_once "TVB/OAuth/common.inc.php";

//try to get the request url
try {
    $req = OAuthRequest::from_request();
    if (isset($tvb_server) && is_object($tvb_server)) {
        $token = $tvb_server->fetch_request_token($req);
        print $token;
        exit;
    }
    else {
        #echo OAuthConfig::MISSING_NECESSARY_PARAM;
        throw new OAuthException('Invalid Request Token '.$request['oauth_token']);
        exit;
    }
}
catch (OAuthException $e) {
    #echo OAuthConfig::OTHER_OAUTH_ERROR;
    print($e->getMessage() . "\n<hr />\n");
    print_r($req);
    exit;
}


?>
